﻿using System;
using Newtonsoft.Json.Linq;
using JsonCSharpClassGenerator;

namespace MyVideoTek
{

    internal class CastMember
    {

        private JObject __jobject;
        public CastMember(JObject obj)
        {
            this.__jobject = obj;
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private Person _person;
        public Person Person
        {
            get
            {
                if(_person == null)
                    _person = JsonClassHelper.ReadStronglyTypedObject<Person>(JsonClassHelper.GetJToken<JObject>(__jobject, "person"));
                return _person;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private Activity _activity;
        public Activity Activity
        {
            get
            {
                if(_activity == null)
                    _activity = JsonClassHelper.ReadStronglyTypedObject<Activity>(JsonClassHelper.GetJToken<JObject>(__jobject, "activity"));
                return _activity;
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private PersonVoice _personVoice;
        public PersonVoice PersonVoice
        {
            get
            {
                if(_personVoice == null)
                    _personVoice = JsonClassHelper.ReadStronglyTypedObject<PersonVoice>(JsonClassHelper.GetJToken<JObject>(__jobject, "personVoice"));
                return _personVoice;
            }
        }

        public string Role
        {
            get
            {
                return JsonClassHelper.ReadString(JsonClassHelper.GetJToken<JValue>(__jobject, "role"));
            }
        }

        [System.Diagnostics.DebuggerBrowsable(System.Diagnostics.DebuggerBrowsableState.Never)]
        private Picture _picture;
        public Picture Picture
        {
            get
            {
                if(_picture == null)
                    _picture = JsonClassHelper.ReadStronglyTypedObject<Picture>(JsonClassHelper.GetJToken<JObject>(__jobject, "picture"));
                return _picture;
            }
        }

    }
}
